package com.kylin.common.security.exception;

import org.springframework.security.core.AuthenticationException;

/**
 * 自定义认证异常
 * @author wuhao
 * @version 1.0 - 2023/6/6
 */
public class CustomAuthenticationException extends AuthenticationException {

    /**
     * 错误码
     */
    private int code;

    public CustomAuthenticationException(String msg, Throwable cause) {
        super(msg, cause);
    }

    public CustomAuthenticationException(String msg) {
        super(msg);
    }

    public CustomAuthenticationException(int code,String msg) {
        super(msg);
        this.code = code;
    }

    public int getCode(){
        return code;
    }
}
